import 'package:get/get.dart';
import 'package:smart_ai_dart/middlewares/authorize.dart';
import 'package:smart_ai_dart/pages/home_page/controller.dart';
import 'package:smart_ai_dart/pages/learn_page/controller.dart';
import 'package:smart_ai_dart/pages/learn_page/index.dart';
import 'package:smart_ai_dart/pages/login_page/controller.dart';
import 'package:smart_ai_dart/pages/login_page/index.dart';
import 'package:smart_ai_dart/pages/main_page/controller.dart';
import 'package:smart_ai_dart/pages/main_page/index.dart';
import 'package:smart_ai_dart/pages/profile_page/controller.dart';
import 'package:smart_ai_dart/pages/search_page/index.dart';
import 'package:smart_ai_dart/pages/edit_profile_page/index.dart';
import 'package:smart_ai_dart/pages/edit_profile_page/controller.dart';
import 'package:smart_ai_dart/pages/search_page/controller.dart';

part 'app_routes.dart';

class AppPages {
  static const INITIAL = Routes.MAIN;

  static final routes = [
    GetPage(
      name: Routes.MAIN,
      page: () => const MainPage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<MainController>(() => MainController());
        Get.lazyPut<HomeController>(() => HomeController());
        Get.lazyPut<ProfileController>(() => ProfileController());
      }),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: Routes.LOGIN,
      page: () => const LoginPage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<LoginController>(() => LoginController());
      }),
    ),
    GetPage(
        name: Routes.SEARCH,
        page: () => const SearchPage(),
        binding: BindingsBuilder(() {
          Get.lazyPut<SearchController>(() => SearchController());
        })),
    GetPage(
      name: Routes.EDIT_PROFILE,
      page: () => const EditProfilePage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<EditProfileController>(() => EditProfileController());
      }),
    ),
    GetPage(
      name: Routes.LEARN,
      page: () => const LearnPage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<LearnController>(() => LearnController());
      }),
    ),
  ];
}
